#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int search(vector<int>& nums, int target) {
	//sort(nums.begin(), nums.end());
	int newbegin = 0;
	int newend = nums.size();
	int mid = (newbegin+newend)/2;
	while (newbegin<newend) {
		if (nums[mid] > target) {
			newend = mid;
		}
		else if (nums[mid] == target) return mid;
		else {
			newbegin = mid;
		}
		mid = (newbegin + newend) / 2;
	}
	if (nums[mid + 1] == target) return mid + 1;
	return -1;
}
int main()
{
	vector<int>vec;
	int target;
	cin >> target;
	int n;
	while (cin >> n) {
		vec.push_back(n);
		if (cin.get() == '\n') break;
	}
	cout << search(vec, target);
	return 0;
}